<!DOCTYPE html>
<html lang="Zh-CN">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>采购历史数据</title>
        <!-- plugins:css -->
        <link rel="stylesheet" href="/static/vendors/mdi/css/materialdesignicons.min.css">
        <link rel="stylesheet" href="/static/vendors/base/vendor.bundle.base.css">
        <!-- endinject -->
        <!-- plugin css for this page -->
        <link rel="stylesheet" href="/static/vendors/datatables.net-bs4/dataTables.bootstrap4.css">
        <!-- End plugin css for this page -->
        <!-- inject:css -->
        <link rel="stylesheet" href="/static/css/style.css">
        <!-- endinject -->
        <link rel="shortcut icon" href="/static/images/favicon.png" />
    </head>
    <body>
        <div class="container-scroller">
            <nav class="navbar col-lg-12 col-12 p-0 d-flex flex-row fixed-top">
                <div class="navbar-brand-wrapper d-flex justify-content-center">
                      <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">
                        <a class="navbar-brand brand-logo" href="{% url 'login:index1' %}"><img src="/static/images/logo.svg" alt="logo"/></a>
                        <a class="navbar-brand brand-logo-mini" href="{% url 'login:index1' %}"><img src="/static/images/logo-mini.svg" alt="logo"/></a>
                        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
                          <span class="mdi mdi-sort-variant">
                          </span>
                        </button>
                      </div>
                  </div>
                <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
                  <ul class="navbar-nav navbar-nav-right">
                    <li class="nav-item dropdown me-4">
                      <a class="nav-link count-indicator dropdown-toggle d-flex align-items-center justify-content-center notification-dropdown" id="notificationDropdown" href="#" data-bs-toggle="dropdown">
                        <i class="mdi mdi-bell mx-0"></i>
                        <span class="count"></span>
                      </a>
                      <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="notificationDropdown">
                        <p class="mb-0 font-weight-normal float-left dropdown-header">待办通知</p>
                        <a class="dropdown-item">
                          <div class="item-thumbnail">
                            <div class="item-icon bg-success">
                              <i class="mdi mdi-information mx-0"></i>
                            </div>
                          </div>
                          <div class="item-content">
                            <h6 class="font-weight-normal">未处理事务</h6>
                            <p class="font-weight-light small-text mb-0 text-muted">
                              您有未处理的订单
                            </p>
                          </div>
                        </a>
                      </div>
                    </li>
                    <li class="nav-item nav-profile dropdown">
                      <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown"
                      id="profileDropdown">
                        <img src="/static/images/faces/face-czw.jpg" alt="profile">
                        <span class="nav-profile-name">赤之王</span>
                      </a>
                      <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
                        <a class="dropdown-item">
                          <i class="mdi mdi-settings text-primary"></i>
                          账户设置
                        </a>
                        <a class="dropdown-item">
                          <i class="mdi mdi-logout text-primary"></i>
                          下班！
                        </a>
                      </div>
                    </li>
                  </ul>
                  <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
                    <span class="mdi mdi-menu"></span>
                  </button>
                </div>
              </nav>
            <div class="container-fluid page-body-wrapper pt-0 proBanner-padding-top">
              <nav class="sidebar sidebar-offcanvas active" id="sidebar">
                    <ul class="nav">
                      <li class="nav-item">
                        <a class="nav-link" href="{% url 'proc:index_views' %}">
                          <i class="mdi mdi-home menu-icon"></i>
                          <span class="menu-title">采购管理中台</span>
                        </a>
                      </li>
                    </ul>
                </nav>
                <div class="main-panel">
                    <div class="content-wrapper">
                      <div class="row grid-margin stretch-card"><!--根据库存方面发来的请求填充内容-->
                        <div class="card">
                          <div class="card-body">
                            <h class="card-title">商品采购请求</h>
                            <div class="table-responsive">
                              <table class="table table-hover">
                                <thead>
                                  <tr class="table-light">
                                    <th>需求编号</th>
                                    <th>员工代码</th>
                                    <th>商品代码</th>
                                    <th>采购请求量</th>
                                  </tr>
                                </thead>
                                <tbody>
                                {% for item in replenish %}
                                  <tr class="table-warning">
                                    <td>{{item.procure_id}}</td>
                                    <td>{{item.eid.eid.eid}}</td>
                                    <td>{{item.goods.goods.goods_id}}</td>
                                    <td>{{item.request_num}}</td>
                                  </tr>
                                {% endfor %}
                                </tbody>
                              </table>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="row grid-margin stretch-card"><!--跟下面的订单信息一样，根据数据库填内容-->
                        <div class="card">
                          <div class="card-body">
                            <h class="card-title">采购计划信息表</h>
                            <div class="table-responsive pt-3">
                              <table class="table table-bordered">
                                <thead>
                                  <tr class="table-light">
                                    <th>计划编号</th>
                                    <th>项目概况</th>
                                    <th>采购原则</th>
                                    <th>采购内容</th>
                                    <th>总预算</th>
                                    <th>审批状态</th>
                                  </tr>
                                </thead>
                                <tbody>
                                {% for item in plan %}
                                  <tr class="table-info">
                                    <td>{{item.procure.procure_id}}</td>
                                    <td>{{item.project_intro}}</td>
                                    <td>{{item.procure_rule}}</td>
                                    <td>{{item.procure_content}}</td>
                                    <td>{{item.money}}</td>
                                    <td>{{item.check_status}}</td>
                                  </tr>
                                {% endfor %}
                                </tbody>
                              </table>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="row grid-margin stretch-card">
                        <div class="card">
                          <div class="card-body">
                            <h class="card-title">采购订单信息表</h>
                             <div class="table-responsive pt-3">
                              <table class="table table-bordered">
                                <thead>
                                  <tr class="table-light">
                                    <th>订单编号</th>
                                    <th>商品品名</th>
                                    <th>商品编号</th>
                                    <th>供应商编号</th>
                                    <th>采购数量</th>
                                    <th>采购价格</th>
                                    <th>运输信息(点击查看详情)</th>
                                  </tr>
                                </thead>
                                <tbody>
                                {% for item in order %}
                                  <tr class="table-info">
                                    <td>{{item.procure.procure.procure_id}}</td>
                                    <td>{{item.procure.procure.goods.goods.goods_name}}</td>
                                    <td>{{item.procure.procure.goods.goods_id}}</td>
                                    <td>{{item.sup.sup_id}}</td>
                                    <td>{{item.procure_num}}</td>
                                    <td>{{item.procure_price}}</td>
                                    <td>
                                    <form action="{% url 'proc:logi' %}" method="POST">
                                      {% csrf_token %}
                                      <input type="hidden" name="物流单" value="{{item.order_logi_procure.all.first.logi_id}}">
                                      <input type="submit" value="{{item.order_logi_procure.all.first.logi_status}}">
                                    </form>
                                    </td>
                                  </tr>
                                {% endfor %}
                                </tbody>
                              </table>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="row grid-margin stretch-card"><!--可以查询未入库的采购订单生成内容，记得核验过后修改订单状态-->
                        <div class="card">
                          <div class="card-body">
                            <h class="card-title">入库核验信息表</h>
                             <div class="table-responsive pt-3">
                              <table class="table table-bordered">
                                <thead>
                                  <tr class="table-light">
                                    <th>采购订单编号</th>
                                    <th>货物核验进度</th>
                                    <th>核验结果</th>
                                  </tr>
                                </thead>
                                <tbody>
                                {% for item in quality %}
                                  <tr class="table-info">
                                    <td>{{item.procure.procure_id}}</td>
                                    <td>
                                      <div class="progress" style="height: 20px;">
                                        <div class="progress-bar" role="progressbar"
                                        style="width: {{item.pro}}%;" aria-valuenow="{{item.pro}}" aria-valuemin="0"
                                        aria-valuemax="100">
                                          {{item.quality_status}}
                                        </div>
                                      </div>
                                    </td>
                                    <td>{{item.quality_result}}</td>
                                  </tr>
                                {% endfor %}
                                </tbody>
                              </table>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <footer class="footer">
                      <div class="d-sm-flex justify-content-center justify-content-sm-between">
                        <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">
                          Copyright ©
                          <a href="https://www.bootstrapdash.com/" target="_blank">bootstrapdash.com </a>
                          2021
                        </span>
                        <span class="float-none float-sm-right d-block mt-1 mt-sm-0 text-center">
                          Only the best <a href="https://www.bootstrapdash.com/" target="_blank"> Bootstrap dashboard  </a>
                          templates
                        </span>
                      </div>
                    </footer>
                </div>
            </div>
        </div>
    <!-- plugins:js -->
    <script src="/static/vendors/base/vendor.bundle.base.js"></script>
    <!-- endinject -->
    <!-- Plugin js for this page-->
    <script src="/static/vendors/chart.js/Chart.min.js"></script>
    <script src="/static/vendors/datatables.net/jquery.dataTables.js"></script>
    <script src="/static/vendors/datatables.net-bs4/dataTables.bootstrap4.js"></script>
    <!-- End plugin js for this page-->
    <!-- inject:js -->
    <script src="/static/js/off-canvas.js"></script>
    <script src="/static/js/hoverable-collapse.js"></script>
    <script src="/static/js/template.js"></script>
    <!-- endinject -->
    <!-- Custom js for this page-->
    <script src="/static/js/dashboard.js"></script>
    <script src="/static/js/data-table.js"></script>
    <script src="/static/js/jquery.dataTables.js"></script>
    <script src="/static/js/dataTables.bootstrap4.js"></script>
    <!-- End custom js for this page-->

    <script src="/static/js/jquery.cookie.js" type="text/javascript"></script>
     {% if messages %}
        <script>
            {% for msg in messages %}
                alert('{{ msg.message }}');
            {% endfor %}
        </script>
    {% endif %}
    </body>
</html>